package com.bestcem.xm.om.enums;

import com.bestcem.xm.common.core.enums.CommonEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.ArrayList;
import java.util.List;

/**
 * 预约信息行业
 *
 * @author YiFang <yifang.zhang@idiaoyan.com>
 * @version v1.0
 * @date 2022/6/25 13:59
 */
@Getter
@AllArgsConstructor
public enum OpenPlantFormBookingIndustryEnum implements CommonEnum {
    // 21个行业
    APPLICANT_TRADE_RETAIL(9,"零售｜快消｜家电"),
    APPLICANT_TRADE_DIET(7,"餐饮"),
    APPLICANT_TRADE_VEHICLE(11,"汽车｜交通｜物流"),
    APPLICANT_TRADE_MEDICAL(4,"医疗"),
    APPLICANT_TRADE_ESTATE(5,"地产"),
    APPLICANT_TRADE_TOURISM(8,"旅游｜文化"),
    APPLICANT_TRADE_HOTEL(2,"酒店"),
    APPLICANT_TRADE_FINANCE(10,"银行｜保险｜金融"),
    APPLICANT_TRADE_INTERNET(14,"互联网｜软件｜SaaS"),
    APPLICANT_TRADE_COMMUNICATIONS(15,"通信"),
    APPLICANT_TRADE_COLLEGES(16,"高校"),
    APPLICANT_TRADE_HUMAN_SERVICES(17,"公共事业"),
    APPLICANT_TRADE_HUMAN_CONSULTATION(18,"调研｜咨询｜广告"),
    APPLICANT_TRADE_CARE_BEAUTY(20,"美业"),
    APPLICANT_TRADE_SATISFACTION(21,"满意度频道"),
    APPLICANT_TRADE_OTHER(12,"其他"),
    APPLICANT_TRADE_VERSION(25,"版本定价"),
    APPLICANT_TRADE_PROPERTY(22,"物业"),
    APPLICANT_TRADE_3C(23,"3C｜个人消费电子"),
    APPLICANT_TRADE_GAME(24,"游戏"),
    APPLICANT_TRADE_B2B(26,"B2B");

    private int index;

    private String name;

    @Override
    public int getIndex() {
        return index;
    }

    @Override
    public String getName() {
        return name;
    }

    public static String getNameByIndex(int index) {
        for (OpenPlantFormBookingIndustryEnum temp : OpenPlantFormBookingIndustryEnum.values()) {
            if (temp.getIndex() == index) {
                return temp.getName();
            }
        }
        return "";
    }

    /**
     * 获取行业code列表
     *
     * @return 行业code列表
     */
    public static List<Integer> getIndustryCodeList() {
        List<Integer> industryCodeList = new ArrayList<>();
        for (OpenPlantFormBookingIndustryEnum temp : OpenPlantFormBookingIndustryEnum.values()) {
            industryCodeList.add(temp.getIndex());
        }
        return industryCodeList;
    }
}
